import request from './handler/request';
//API列表
export const API = {
	List: `/products/list.do`, // 商品列表
	CategoryList: `/category/list.do`, //分类列表
	FindById: `/products/getlist.do`, //ID查找
	ProductAddIn: `/products/save.do`,
	SetSelled:`/products/setselled.do`
};

//接口列表
export function List(params) {
	return request.post({
		url: API.List,
		params,
	});
}
export function CategoryList(params) {
	return request.post({
		url: API.CategoryList,
		params,
	});
}
export function FindById(params) {
	return request.get({
		url: API.FindById,
		params,
	});
}
export function ProductAddIn(params) {
	return request.post({
		url: API.ProductAddIn,
		params,
		config: {
			headers: {
				'Content-Type': 'multipart/form-data; charset=utf-8',
			},
		},
	});
}
export function SetSelled(params){
	return request.post({
		url: API.SetSelled,
		params,
	});
}